package org.ohuyo.libra.client.master.webapp.actions;

import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;

import com.opensymphony.xwork2.ActionSupport;

/**
 * 
 * @author rabbit
 * 
 */
@Action("/master/logout")
@Result(type = "redirect", location = "/index.jsp")
public class LogoutAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7993143495988221135L;


	public String execute() throws Exception {
		HttpSession s = ServletActionContext.getRequest().getSession(false);
		if (s != null) {
			s.invalidate();
		}
		return SUCCESS;
	}
}